package controller.arithmethicParser;

import java.io.StringReader;

import model.ParseError;
import model.arithmeticExpression.tokens.Exp;

/**
 * @author Sjaak Smetsers
 * @version 1.0 -- 06-03-2012
 */
public class ArithmeticParser {
	public static Exp parse(String expression) {
		try {
			StringReader inputReader = new StringReader(expression);
			ArithmeticTRparser parser = new ArithmeticTRparser(inputReader);
			return parser.parse();
		} catch (ParseError parseError) {
			System.out.printf("Parse error: %s", parseError);
		}
		
		return null;
	}
}
